﻿@{
    var sels = (SelectList)ViewData["Selects"];
    var htmlatt = (object)ViewData["htmlatt"];
    //if (null != Model)
    //{
    //    foreach (SelectListItem item in sels)
    //    {
    //        if (item.Value == Model.ToString())
    //        {
    //            item.Selected = true;
    //        }
    //    }
    //}
}
<div class="editor-label">
    @Helpers.TryRenderRequiredTag(ViewData.ModelMetadata.IsRequired)

    @Html.LabelFor(model => model)
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model, sels,htmlatt)
    @Html.ValidationMessageFor(model => model)
</div>
